<template>

  <!--
  <i
    @click.stop="helpClick()"
    style="font-size: 12px; margin-left: 4px;"
    :class="hintConf.icon"
  ></i>
  -->


  <THelp
    :inBody="true"
    @click.capture="(e) => { e?.stopPropagation();}"
    style="font-size: 12px; margin-left: 4px;"
    :icon='hintConf.icon'
    linkType='openDia'
    helpPlacement='bottom'
    :hideLabel='true'
    :content="warpMessage"
    hrefType='static'
  ></THelp>

</template>
<style scoped>
  i::before {
    font-size: 12px;
  }
</style>
<style lang="scss">
.t-datagrid-container {
  .tr-label-prefix-wraper{
    i {
      font-size: 12px;
    }
  }
}
</style>
<script>
  import THelp from 't/basic/help';

  export default {
  props: ['column', 'isDevEnv'],
    components: {
      THelp
    },
    data() {
      this.colConf = this.column;
      let hintConf = this.colConf.hintConf;

      if (!this.isDevEnv && Funcs && Funcs.GetTerms) {
        if (hintConf.ValueInfo_message) {
          hintConf.message = Funcs.GetTerms(
            hintConf.ValueInfo_message,
            hintConf.message,
          );
        }
        if (this.colConf.ValueInfo_caption) {
          this.colConf.caption = Funcs.GetTerms(
            this.colConf.ValueInfo_caption?.ReferenceExpr,
            this.colConf.caption,
          );
        }
      }
      return {
        hintConf: hintConf,
      };
    },
    created() {},
    mounted() {},
    methods: {
      helpClick() {
        Funcs.Confirm(this.colConf.caption, this.warpMessage, '', '', true, {
          hideCancelButton: true,
          cancelButtonText: false,
        });
      },
    },
    watch: {},
    computed: {
      warpMessage() {
        return `<pre style="font-family: 'AlibabaPuHuiTi';margin: 0;text-align: left;text-wrap: wrap; white-space: pre-wrap;">${this.hintConf.message}</pre>`;
      },
    },
  };
</script>
